package com.lingxu.module.earlyWarn.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lingxu.base.common.api.vo.Result;
import com.lingxu.module.earlyWarn.entity.IssueManage;
import com.lingxu.module.earlyWarn.entity.IssueParams;
import com.lingxu.module.earlyWarn.mapper.EarlyWarnProbManageMapper;
import com.lingxu.module.earlyWarn.service.EarlyWarnProbManageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Slf4j
@Service
public class EarlyWarnProbManageServiceImpl implements EarlyWarnProbManageService {

    @Autowired
    private EarlyWarnProbManageMapper earlyWarnProbManageMapper;

    /**
     * @Author ysj闫世杰
     * @Description 查询问题列表
     * @Date 2024/1/3 10:37
     * @Param: params
     * @return com.lingxu.base.common.api.vo.Result
     **/
    @Override
    public Result findModelIssueList(IssueParams params) {
        try {
            Page<IssueManage> page = new Page<>(params.getPage(),params.getLimit());
            IPage<IssueManage> dataList = earlyWarnProbManageMapper.findModelIssueList(params,page);
            return Result.ok(dataList,"查询成功");
        }catch (Exception e){
            log.error("数据查询异常",e);
            return Result.error("查询异常");
        }
    }
}
